namespace VAdvantage.Model
{

/** Generated Model - DO NOT CHANGE */
using System;
using System.Text;
using VAdvantage.DataBase;
using VAdvantage.Common;
using VAdvantage.Classes;
using VAdvantage.Process;
using VAdvantage.Model;
using VAdvantage.Utility;
using System.Data;
/** Generated Model for SysTable
 *  @author Jagmohan Bhatt (generated) 
 *  @version Vienna Framework 1.1.1 - $Id$ */
public class X_SysTable : PO
{
public X_SysTable (Context ctx, int SysTable_ID, String trxName) : base (ctx, SysTable_ID, trxName)
{
/** if (SysTable_ID == 0)
{
SetSysTable_ID (0);
}
 */
}
public X_SysTable (Ctx ctx, int SysTable_ID, String trxName) : base (ctx, SysTable_ID, trxName)
{
/** if (SysTable_ID == 0)
{
SetSysTable_ID (0);
}
 */
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_SysTable (Context ctx, DataRow rs, String trxName) : base(ctx, rs, trxName)
{
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_SysTable (Ctx ctx, DataRow rs, String trxName) : base(ctx, rs, trxName)
{
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_SysTable (Ctx ctx, IDataReader dr, String trxName) : base(ctx, dr, trxName)
{
}
/** Static Constructor 
 Set Table ID By Table Name
 added by ->Harwinder */
static X_SysTable()
{
 Table_ID = Get_Table_ID(Table_Name);
 model = new KeyNamePair(Table_ID,Table_Name);
}
/** Serial Version No */
static long serialVersionUID = 27562514384020L;
/** Last Updated Timestamp 7/29/2010 1:07:47 PM */
public static long updatedMS = 1280389067231L;
/** AD_Table_ID=1000022 */
public static int Table_ID;
 // =1000022;

/** TableName=SysTable */
public static String Table_Name="SysTable";

protected static KeyNamePair model;
protected Decimal accessLevel = new Decimal(4);
/** AccessLevel
@return 4 - System 
*/
protected override int Get_AccessLevel()
{
return Convert.ToInt32(accessLevel.ToString());
}
/** Load Meta Data
@param ctx context
@return PO Info
*/
protected override POInfo InitPO (Context ctx)
{
POInfo poi = POInfo.GetPOInfo (ctx, Table_ID);
return poi;
}
/** Load Meta Data
@param ctx context
@return PO Info
*/
protected override POInfo InitPO (Ctx ctx)
{
POInfo poi = POInfo.GetPOInfo (ctx, Table_ID);
return poi;
}
/** Info
@return info
*/
public override String ToString()
{
StringBuilder sb = new StringBuilder ("X_SysTable[").Append(Get_ID()).Append("]");
return sb.ToString();
}
/** Set Account No.
@param AccountNo Account Number */
public void SetAccountNo (int AccountNo)
{
Set_Value ("AccountNo", AccountNo);
}
/** Get Account No.
@return Account Number */
public int GetAccountNo() 
{
Object ii = Get_Value("AccountNo");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Set Amount.
@param Amount Amount in a defined currency */
public void SetAmount (Decimal? Amount)
{
Set_Value ("Amount", (Decimal?)Amount);
}
/** Get Amount.
@return Amount in a defined currency */
public Decimal GetAmount() 
{
Object bd =Get_Value("Amount");
if (bd == null) return Envs.ZERO;
return  Convert.ToDecimal(bd);
}

/** ListSources AD_Reference_ID=208 */
public static int LISTSOURCES_AD_Reference_ID=208;
/** Accounts = A */
public static String LISTSOURCES_Accounts = "A";
/** Business Partner = B */
public static String LISTSOURCES_BusinessPartner = "B";
/** Exchange Rates = E */
public static String LISTSOURCES_ExchangeRates = "E";
/** Inventory Count = I */
public static String LISTSOURCES_InventoryCount = "I";
/** Product = P */
public static String LISTSOURCES_Product = "P";
/** GL Balances = S */
public static String LISTSOURCES_GLBalances = "S";
/** Is test a valid value.
@param test testvalue
@returns true if valid **/
public bool IsListSourcesValid (String test)
{
return test == null || test.Equals("A") || test.Equals("B") || test.Equals("E") || test.Equals("I") || test.Equals("P") || test.Equals("S");
}
/** Set List Sources.
@param ListSources List Report Line Sources */
public void SetListSources (String ListSources)
{
if (!IsListSourcesValid(ListSources))
throw new ArgumentException ("ListSources Invalid value - " + ListSources + " - Reference_ID=208 - A - B - E - I - P - S");
if (ListSources != null && ListSources.Length > 1)
{
log.Warning("Length > 1 - truncated");
ListSources = ListSources.Substring(0,1);
}
Set_Value ("ListSources", ListSources);
}
/** Get List Sources.
@return List Report Line Sources */
public String GetListSources() 
{
return (String)Get_Value("ListSources");
}

/** PreProcessing AD_Reference_ID=347 */
public static int PREPROCESSING_AD_Reference_ID=347;
/** Current Active = A */
public static String PREPROCESSING_CurrentActive = "A";
/** Future = F */
public static String PREPROCESSING_Future = "F";
/** Maintenance = M */
public static String PREPROCESSING_Maintenance = "M";
/** Make-To-Order = O */
public static String PREPROCESSING_Make_To_Order = "O";
/** Previous = P */
public static String PREPROCESSING_Previous = "P";
/** Repair = R */
public static String PREPROCESSING_Repair = "R";
/** Previous, Spare = S */
public static String PREPROCESSING_PreviousSpare = "S";
/** Is test a valid value.
@param test testvalue
@returns true if valid **/
public bool IsPreProcessingValid (String test)
{
return test == null || test.Equals("A") || test.Equals("F") || test.Equals("M") || test.Equals("O") || test.Equals("P") || test.Equals("R") || test.Equals("S");
}
/** Set Pre Processing.
@param PreProcessing Process SQL before executing the query */
public void SetPreProcessing (String PreProcessing)
{
if (!IsPreProcessingValid(PreProcessing))
throw new ArgumentException ("PreProcessing Invalid value - " + PreProcessing + " - Reference_ID=347 - A - F - M - O - P - R - S");
if (PreProcessing != null && PreProcessing.Length > 50)
{
log.Warning("Length > 50 - truncated");
PreProcessing = PreProcessing.Substring(0,50);
}
Set_Value ("PreProcessing", PreProcessing);
}
/** Get Pre Processing.
@return Process SQL before executing the query */
public String GetPreProcessing() 
{
return (String)Get_Value("PreProcessing");
}
/** Set SysCost_Name.
@param SysCost SysCost_Name */
public void SetSysCost (Decimal? SysCost)
{
Set_Value ("SysCost", (Decimal?)SysCost);
}
/** Get SysCost_Name.
@return SysCost_Name */
public Decimal GetSysCost() 
{
Object bd =Get_Value("SysCost");
if (bd == null) return Envs.ZERO;
return  Convert.ToDecimal(bd);
}
/** Set SysTable_ID.
@param SysTable_ID SysTable_ID */
public void SetSysTable_ID (int SysTable_ID)
{
if (SysTable_ID < 1) throw new ArgumentException ("SysTable_ID is mandatory.");
Set_ValueNoCheck ("SysTable_ID", SysTable_ID);
}
/** Get SysTable_ID.
@return SysTable_ID */
public int GetSysTable_ID() 
{
Object ii = Get_Value("SysTable_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
}

}
